package com.yiwei.ydd.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;


import com.yiwei.ydd.MainActivity;
import com.yiwei.ydd.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by xsooy-pc on 17-12-7.
 */

public class GuideFragment extends BaseFragment {
    @BindView(R.id.img_guide)
    ImageView imgGuide;

    private Unbinder unbinder;
    private int poi;

    public void setPoi(int poi) {
        this.poi = poi;
    }

    @Override
    protected int setLayoutId() {
        return R.layout.fragment_guide;
    }

    @Override
    protected void initView() {
        switch (poi) {
            case 0:
                imgGuide.setImageResource(R.mipmap.img_welcome_one);

                break;
            case 1:
                imgGuide.setImageResource(R.mipmap.img_welcome_two);
                break;
            case 2:
                imgGuide.setImageResource(R.mipmap.img_welcome_three);
                break;
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        unbinder = ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        imgGuide.setImageDrawable(null);
        unbinder.unbind();
    }

}
